package com.zp2.controller.api;

import com.zp2.model.user.UserLoginVo;
import com.zp2.service.UserService;
import com.zp2.util.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserInfoController {
    @Autowired
    private UserService userService;

    @PostMapping("/login")
    public Result getUserInfo(@RequestBody UserLoginVo userLoginVo) {
        return userService.getUserInfo(userLoginVo);
    }

    @GetMapping("/sms")
    public Result smsLogin(@RequestParam("phone") String phone) {
        return userService.smsLogin(phone);
    }
}
